<template>
	<view class='uni-flex uni-row' style="-webkit-justify-content: space-between;justify-content: space-between;">
		<view  class='uni-flex uni-row' >
			
		
		<button   class="text " type="primary" plain @click="addClick">确认</button>
		<button  class="text" type="primary" plain >取消</button>
		
		<button v-if="!hasLeftWin && powers.includes(power.show.power)" class="text" type="primary" plain size="mini">查看</button>
		<button  class="text" type="primary" plain size="mini">刷新</button>
		</view>
		
		<view class='uni-flex uni-row'  v-if="!hasLeftWin">
		<button class="text" type="primary" plain >打印</button>
		<uni-data-select class="print"
			:clear="false"
			  v-model="value"
			  :localdata="range"
			  @change="change"
		></uni-data-select>
		<uni-data-select class="printreport"
			:clear="false"
			  v-model="value1"
			  :localdata="range1"
			  @change="change"
		></uni-data-select>
		
		</view>
		<!-- <view class='uni-flex uni-row'>
		<button class="text" type="primary" plain >筛选条件</button>
		
		</view> -->
		<!-- <view class='uni-flex uni-row'>			
		
		</view> -->
		
	</view>
</template>

<script setup>	
import { computed,ref } from "vue";
import  store  from "@/store/index.js"
const props = defineProps({
	power:{
		type:Object,
		required:true,
		default() {
		      return { add:{},remove:{},edit:{},show:{} }
		}
	}
}
)
const hasLeftWin = computed(() => store.state.noMatchLeftWindow)
const powers = computed(() => store.state.userPower)
const value=ref('');
const range=ref([
	{ value: '0', text: "打印预览" },
	{ value: '1', text: "报表设计" },
	{ value: '2', text: "新增打印样式" },		
	{ value: '3', text: "删除专属样式" },		
	{ value: '4', text: "打开本地位置" },
]);
const value1=ref('默认打印报表一（公用）');
const range1=ref([
	{ value: '默认打印报表一（公用）', text: "默认打印报表一（公用）" },
	{ value: '打印报表二（公用）', text: "打印报表二（公用）" },
	{ value: '>', text: "打印报表一（专属）" },		
	{ value: '<', text: "打印报表二（专属）" },		
	{ value: '<=', text: "打印报表三（专属）" },
]);
const change=function(){
	console.log('dddd')
}
//增删改查
const addClick=function(){
	
	if (typeof props.power.add.url === 'string'){
		uni.navigateTo({
			url:props.power.add.url
		})
	}else{
		uni.navigateTo({
			url:props.power.add.url.url+props.power.add.url.url_path
		})
	}
	
};

</script>

<style lang="scss" scoped>
.text {
		margin: 15rpx 10rpx;
		padding: 0 20rpx;
		background-color: #ebebeb;
		height: 70rpx;
		line-height: 70rpx;
		text-align: center;
		color: #777;
		font-size: 26rpx;
}
.print{
	min-width: 280rpx;
}
.printreport{
	min-width: 450rpx;
}	
</style>